package com.simple.common.entity.dto.pay.vm;

import com.simple.common.entity.ReqContext;
import com.simple.common.entity.po.sys.*;
import lombok.Data;

import java.util.Map;

/**
 * @author yasud
 * @date 2020年10月10日 14:23
 * @description
 */
@Data
public class RefundTradeDto extends VmBaseDto {

    /**
     * 退款订单
     */
    private RefundTrade refundTrade;

    /**
     * 每条详细
     */
    private RefundTradeInventory inventory;

    /**
     * 提供静态方法方便创建
     *
     * @param trade
     * @param context
     * @param extra
     * @param channel
     * @param product
     * @return
     */
    public static RefundTradeDto generateDto(Trade trade,
                                             RefundTrade refundTrade,
                                             RefundTradeInventory inventory,
                                             ReqContext context,
                                             Map<String, Object> extra,
                                             ChannelComp channel,
                                             Product product) {
        RefundTradeDto refundTradeDto = new RefundTradeDto();
        refundTradeDto.setRefundTrade(refundTrade);
        refundTradeDto.setInventory(inventory);
        refundTradeDto.setTrade(trade);
        refundTradeDto.setContext(context);
        refundTradeDto.setExtra(extra);
        refundTradeDto.setChannel(channel);
        refundTradeDto.setProduct(product);
        return refundTradeDto;
    }
}
